package com.binarysoft.service.operlog;

import java.sql.Connection;
import java.util.ArrayList;
import java.util.Collection;

import com.binarysoft.service.common.multiconnpool.MultipleConnectionPoolService;
import common.framework.dsb.client.DefaultServiceFactory;
import common.framework.dsb.client.ServiceFactory;
import common.framework.log.Logger;

public class OperLogMysqlDAO implements OperLogDAO {

	@Override
	public Collection<OperLog> queryOperLog(long fromTime, long endTime) throws Exception {
		ServiceFactory serviceFactory = new DefaultServiceFactory();
		MultipleConnectionPoolService connectionPoolService = serviceFactory.lookup("DSB/MultipleConnectionPoolService");
		String sql = "select * from oper_log where oper_time >= ? and oper_time <= ? order by oper_time desc";
		Collection<OperLog> result = new ArrayList<OperLog>();

		return result;
	}

	@Override
	public Collection<OperLog> queryOperLog(long fromTime, long endTime, String userID) throws Exception {
		ServiceFactory serviceFactory = new DefaultServiceFactory();
		MultipleConnectionPoolService connectionPoolService = serviceFactory.lookup("DSB/MultipleConnectionPoolService");
		String sql = "select * from oper_log where oper_time >= ? and oper_time <= ? and user_id = ?  order by oper_time desc";
		Collection<OperLog> result = new ArrayList<OperLog>();

		return result;
	}

	@Override
	public void log(OperLog operLog) throws Exception {

	}

	@Override
	public void log(Collection<OperLog> operLogs) throws Exception {

	}

	@Override
	public void deleteLog(long fromTime, long endTime) throws Exception {
		Logger.log(Logger.FUNCTION_LEVEL, "remove operate log with formTime: " + fromTime + " to endTime:" + endTime);

	}

	@Override
	public void deleteLog(long fromTime, long endTime, String userID) throws Exception {
		Logger.log(Logger.FUNCTION_LEVEL, "remove operate log with formtime: " + fromTime + " and endtime:" + endTime + " and userID:" + userID);

	}

}
